home *** CD-ROM | disk | FTP | other *** search
- Path: news.ping.at!usenet
- From: Andreas Schwab <andycom@ping.at>
- Newsgroups: comp.lang.c++
- Subject: Help: How can I use Delphi-DLLs with BC++? It doesn't work as documented!
- Date: Sat, 17 Feb 1996 15:16:52 +0100
- Organization: ping - Personal InterNet Gate
- Message-ID: <3125E354.99@ping.at>
- NNTP-Posting-Host: e234.ping.at
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- I have the following problem: I want to use a Delphi 1.0-DLL (includes a
- form) with Borland C++ 4.5 but it doesn't work. I allways get the
- following error-message:
-
- Linker Error: Undefinde symbol readvalue() in module DLLTEST.CPP
-
- Could anybody help me and tell me what the problem is? Maybe you could
- tell me where I can find a program which uses a Delphi-DLL or otherwise
- what do I make wrong?
-
- Thanks a lot, Andreas Schwab
-
- ---------------------------
- Here is my program and after it the def-file:
-
- CPP-Datei:
- /*
- program: dlltest
- language: borland c++
- compiler: bc 4.5
- operating sys.: windows 16 Bit
- tested: windows 95
- author: schwab andreas
- date: 1996-02-17
- action: beispielprogramm zum einbinden einer delphi-dll
- release: 1.0
- */
- #include <owl\owlpch.h>
- #include <owl\applicat.h>
- #include <owl\framewin.h>
- #include <stdlib.h>
- #include <c:\datas\bc45\dlltest\dlltest.rc>
-
- int FAR PASCAL ReadValue();
-
- class TDLLWindow: public TWindow
- {
- public:
- TDLLWindow(TWindow* parent = 0);
- protected:
- BOOL DBRun;
- void CmTest(); // botschaftsbeantwortungsfunktionen
- void CmExit();
- void CmAbout();
- DECLARE_RESPONSE_TABLE(TDLLWindow);
- };
-
- DEFINE_RESPONSE_TABLE1(TDLLWindow, TWindow)
- EV_COMMAND(CM_TEST, CmTest),
- EV_COMMAND(CM_EXIT, CmExit),
- EV_COMMAND(CM_ABOUT, CmAbout),
- END_RESPONSE_TABLE;
-
- /*
- constructor: tdllwindow::tdllwindow
- task: instantiiert tdllwindow
- */
- TDLLWindow::TDLLWindow(TWindow* parent)
- {
- Init(parent, 0, 0); // instantiiert das fenster
- }
-
- void TDLLWindow::CmTest()
- {
- int valueI;
- valueI = 1;
- ReadValue();
- //MessageBox("Feature not implemented", "Test", MB_OK);
- }
-
- void TDLLWindow::CmExit()
- {
- MessageBox("Feature not implemented", "Exit", MB_OK);
- }
-
- void TDLLWindow::CmAbout()
- {
- MessageBox("Feature not implemented", "About", MB_OK);
- }
-
- class TMyApp: public TApplication
- {
- public:
- TMyApp(): TApplication() {}
- void InitMainWindow();
- };
-
- void TMyApp::InitMainWindow()
- {
- SetMainWindow(new TFrameWindow(0, "DLL Test", new TDLLWindow));
- GetMainWindow()->AssignMenu("COMMANDS");
- }
-
- int OwlMain(int /*argc*/, char* /*argv*/ [])
- {
- return TMyApp().Run();
- }
-
- DEF-file:
- IMPORTS
- ReadValue=DELPHDLL.ReadValue
-
- STACKSIZE 6144
-
-